package xin.vote.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;

import xin.vote.model.MatchPKInfo;
import xin.vote.service.IVotePkService;
import xin.vote.util.Result;

@Controller
@RequestMapping("/votepk")
public class VotePKController {
	@Resource
	private IVotePkService votePkService;
	
	//正在投票
	@RequestMapping("/findpkinfo")
	public ModelAndView findAllPlayer() {// defaultValue="0",这里是null
		List<MatchPKInfo> playerList = votePkService.findPKInfoing();
		ModelAndView mav = new ModelAndView("users/vote");
		
		mav.addObject("result",JSON.toJSONString(playerList));
		return mav;
	}
}
